﻿
Imports xhtmlctrl
Imports webctrl

Public Class pagination
    Inherits webctrl.pagination

    Private Shadows Class datasource
        Inherits webctrl.pagination.datasource

        Public key As String = Nothing

        Public Function generatelink(ByVal first As Int64) As a
            Return view.generateViewlink(key, first)
        End Function

        Public Sub New()
            linkgenerator2 = AddressOf generatelink
            prepageText = httpServer2.currentContext().string(stringId.PAGINATION_PREV)
            nextpageText = httpServer2.currentContext().string(stringId.PAGINATION_NEXT)
            countPerPage = view.resultPerPage
            linkcount = view.paginationLinkCount
        End Sub
    End Class

    Public Shadows Sub setData(ByVal page As xhtmlpage, ByVal key As String, _
                               ByVal first As Int64, ByVal count As Int64)
        Dim ds As datasource = Nothing
        ds = New datasource()
        copy(ds.key, key)
        ds.first = first
        ds.count = count
        ds.page = page

        MyBase.setData(ds)
    End Sub
End Class
